package com.xujie.sportsmeeting.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 运动员实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("athlete")
public class Athlete implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 运动员ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 关联用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 学号
     */
    @NotBlank(message = "学号不能为空")
    @TableField("student_number")
    private String studentNumber;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    @TableField("real_name")
    private String realName;

    /**
     * 性别 0-男 1-女
     */
    @TableField("gender")
    private Integer gender;

    /**
     * 年龄
     */
    @TableField("age")
    private Integer age;

    /**
     * 联系方式
     */
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @TableField("phone")
    private String phone;

    /**
     * 邮箱
     */
    @Email(message = "邮箱格式不正确")
    @TableField("email")
    private String email;

    /**
     * 所属院系
     */
    @NotBlank(message = "所属院系不能为空")
    @TableField("department")
    private String department;

    /**
     * 所属班级
     */
    @NotBlank(message = "所属班级不能为空")
    @TableField("class_name")
    private String className;

    /**
     * 身份证号
     */
    @TableField("id_card")
    private String idCard;

    /**
     * 身高(cm)
     */
    @TableField("height")
    private BigDecimal height;

    /**
     * 体重(kg)
     */
    @TableField("weight")
    private BigDecimal weight;

    /**
     * 运动特长
     */
    @TableField("specialty")
    private String specialty;

    /**
     * 状态 0-禁用 1-正常
     */
    @TableField("status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
